package com.example.service.impl;

import com.example.service.UserService;
import com.example.web.ActivityZhaoBoController;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Override
    public User getOneUserByName(String userName) {
        String s = ActivityZhaoBoController.map.get(userName);
        List<GrantedAuthority> authorityList = AuthorityUtils.createAuthorityList("GROUP_"+s,s);
        return new User(userName, "", authorityList);
    }
}